﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Small.Html.Options
{
    public class JqEditrule:JqBase
    {
        List<String> list = new List<string>();
            
            
            
            

            
        private bool edithidden;

        public bool Edithidden
        {
            get { return edithidden; }
            set { edithidden = value;
            
            list.Add(IsBool("edithidden", edithidden));}
        }
        private bool required;

        public bool Required
        {
            get { return required; }
            set { required = value; 
            list.Add(IsBool("required", required));
            }
        }
        private bool number;

        public bool Number
        {
            get { return number; }
            set { number = value;
                 list.Add(IsBool("number", number));
           
            }
        }
        private bool integer;

        public bool Integer
        {
            get { return integer; }
            set { integer = value;
            list.Add(IsBool("integer", integer));
            }
        }

                    
            
         
           
        private decimal minValue;

        public decimal MinValue
        {
            get { return minValue; }
            set { minValue = value;
               list.Add(IsDecimal("minValue", minValue));
            }
        }
        private decimal maxValue;

        public decimal MaxValue
        {
            get { return maxValue; }
            set { maxValue = value; 
             list.Add(IsDecimal("mxnValue", maxValue));
            }
        }
        private bool email;

        public bool Email
        {
            get { return email; }
            set { email = value; 
            list.Add(IsBool("email", email));
            }
        }
        
           
            
            
           
       
        private bool url;

        public bool Url
        {
            get { return url; }
            set { url = value; 
            list.Add(IsBool("url", url));
            }
        }
        private bool date;

        public bool Date
        {
            get { return date; }
            set { date = value;
             list.Add(IsBool("date", date));
            }
        }
        private bool time;

        public bool Time
        {
            get { return time; }
            set { time = value;
            list.Add(IsBool("time", time));
            }
        }

        private bool custom;

        public bool Custom1
        {
            get { return custom; }
            set { custom = value;
            list.Add(IsBool("custom", custom));
            }
        }

        /// <summary>
        /// 是否自定义验证
        /// </summary>
        public bool Custom
        {
            get { return custom; }
            set { custom = value; }
        }
        private string fnCustom_func;

        /// <summary>
        /// 用户自定义验证函数
        /// </summary>
        public string FnCustom_func
        {
            get { return fnCustom_func; }
            set { fnCustom_func = value;
             list.Add(IsStringNull("custom_func", fnCustom_func));
            }
        }


        public override string GenerateString()
        {
            
            return "  editrules:{"+String.Join(",",list.ToArray())+"} " ;
        }
        
    }
}
